import { useParams, useSearchParams } from 'react-router-dom'
function WithRoute(MyComponent) {
    function NewComponent(props) {
        let params = useParams();
        let search = useSearchParams();
        return <MyComponent router={{
            params:params,
            search:search
        }} {...props}></MyComponent>
    }
    return  NewComponent;
}

export default WithRoute;